﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VoluntariadoMobileViewModel;
using VoluntariadoMobileModel;

namespace VoluntariadoMobileWPFTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = new VoluntariadoGeolocalizadoViewModel(40.3, -3.2, 1000000);
        }

        private void dataGrid1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Subscribirse subs = new Subscribirse();
            UsuarioOportunidadViewModel uoviewmodel = new UsuarioOportunidadViewModel();
            uoviewmodel.idOportunidad = ((VoluntariadoGeolocalizado)e.AddedItems[0]).idOportunidad;
            subs.DataContext = uoviewmodel;
            subs.ShowDialog();            
        }

     
    }
}
